package com.zkthink.ceres.common.enums;

import com.zkthink.exception.BizException;
import lombok.Getter;

/**
 * @Author Xiaoyan
 * @create 2022/1/3 17:22
 */
@Getter
public enum MakeFriendsStateEnum {
    NO_ONE_SIGNED_UP_STATE(0, "无人报名"),
    WAITING_FOR_SELECTION_STATE(1, "等待选择"),
    SELECTED_STATE(2, "已选择"),
    UNDO_ACTIVITY_STATE(3, "撤销活动"),
    COMPLETED_STATE(4, "活动已完成");

    private int code;

    private String desc;

    MakeFriendsStateEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static MakeFriendsStateEnum getDscByType(Integer type) {
        for (MakeFriendsStateEnum p : values()) {
            if (p.getCode() == type.intValue()) {
                return p;
            }
        }
        throw new BizException("no support promotionPlan");
    }
}
